package com.bgrc.hubu12305.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bgrc.hubu12305.entity.SeatEntity;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 包名:com.bgrc.hubu12305.dao
 * 用户:86182
 * 时间:2021121:082021/12/16
 */
@Mapper
public interface SeatDao extends BaseMapper<SeatEntity> {

    /**
     * 通过车编号和座位等级查座位数
     * */
    Integer querySeatCountByType(String trainNo,Integer seatType);

    /**
     * 通过编号查询不同座位等级和价格
     * */
    @MapKey("title")
    List<Map<String,Integer>> queryPrice(@Param("trainNumber") String trainNumber);

    @MapKey("carriage_no")
    List<Map<String, Object>> queryCarriages(String seatType, String trainNumber);
}
